# _*_ coding:utf-8 _*_
# @Time : 2023/5/25 17:57
# @Author : wsl
# @File : day05_demo
# @Project : python
from bs4 import BeautifulSoup

soup = BeautifulSoup(open('xpth.html', encoding='utf-8'), 'lxml')
print(soup.a)
print(soup.a.attrs)
# 返回第一个
print(soup.find('a'))
print(soup.find('a', title="a2"))
print(soup.find('a', class_="a1"))

# 返回所有的
print(soup.find_all('a'))
# &
print(soup.find_all(['a','span']))
